package oop.java0328.work2;

public class Mouse {
    private String name;
    private int energy;//体力

    public Mouse() {
    }

    public Mouse(String name, int energy) {
        this.name = name;
        this.energy = energy;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getEnergy() {
        return energy;
    }

    public void setEnergy(int energy) {
        this.energy = energy;
    }
    //玩耍
    public void play(){
        System.out.println("玩耍了半天");
        energy-=20;
        System.out.println(name +"当前体力值："+energy);
    }


}
